﻿<Dialogs:DialogWindow x:Class="Mnk.TBox.Plugins.LocalizationTool.Components.Translate"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:loc="clr-namespace:Mnk.TBox.Plugins.LocalizationTool.Code.Localization"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:Dialogs="clr-namespace:Mnk.Library.WpfControls.Dialogs;assembly=Mnk.Library.WPFControls"
             xmlns:WPFSyntaxHighlighter="clr-namespace:Mnk.Library.WpfSyntaxHighlighter;assembly=Mnk.Library.WPFSyntaxHighlighter"
             mc:Ignorable="d" 
             ShowInTaskbar="True" Title="{loc:Tr PluginName}"
             FocusManager.FocusedElement="{Binding ElementName=Source}"
             MinWidth="640" MinHeight="480">
    <DockPanel Margin="2"> 
        <StackPanel  DockPanel.Dock="Bottom" HorizontalAlignment="Right" Orientation="Horizontal" >
            <Button Content="{loc:Tr Cancel}" Name="btnClose" Margin="5" Click="CloseClick" IsCancel="True" />
            <Button Content="{loc:Tr Translate}" Name="btnTranslate" Margin="5" Click="ButtonClick" IsDefault="True" />
        </StackPanel>
        <TabControl Margin="5" Name ="Tabs">
            <TabItem Header="{loc:Tr SourceText}" UseLayoutRounding="False">
                <DockPanel>
                    <Grid DockPanel.Dock="Top">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="128"/>
                            <ColumnDefinition/>
                        </Grid.ColumnDefinitions>
                        <Grid.RowDefinitions>
                            <RowDefinition/>
                            <RowDefinition/>
                        </Grid.RowDefinitions>
                        <Label Content="{loc:Tr InputFormat}" DockPanel.Dock="Left" Grid.Row="0" Grid.Column="0"/>
                        <ComboBox Margin="2" IsReadOnly="True" IsEnabled="True" ItemsSource="{Binding Formats}" SelectedIndex="{Binding SelectedInputFormat}" Grid.Row="0" Grid.Column="1" SelectionChanged="SelectionChanged"/>
                        <Label Content="{loc:Tr TranslateFrom}" DockPanel.Dock="Left" Grid.Row="1" Grid.Column="0"/>
                        <ComboBox Margin="2" IsReadOnly="True" IsEnabled="True" ItemsSource="{Binding Languages}" SelectedIndex="{Binding SelectedLanguageFrom}" Grid.Row="1" Grid.Column="1" SelectionChanged="SelectionChanged"/>
                    </Grid>
                    <WPFSyntaxHighlighter:SyntaxHighlighter Format="js" Name="Source" Text="{Binding Source}"/>
                </DockPanel>
            </TabItem>
            <TabItem Header="{loc:Tr TranslatedTemplates}">
                <DockPanel>
                    <Grid DockPanel.Dock="Top">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="128"/>
                            <ColumnDefinition/>
                        </Grid.ColumnDefinitions>
                        <Grid.RowDefinitions>
                            <RowDefinition/>
                            <RowDefinition/>
                        </Grid.RowDefinitions>
                        <Label Content="{loc:Tr OutputFormat}" Grid.Row="0" Grid.Column="0"/>
                        <ComboBox Margin="2" IsReadOnly="True" IsEnabled="True" ItemsSource="{Binding Formats}" SelectedIndex="{Binding SelectedOutputFormat}" Grid.Row="0" Grid.Column="1" SelectionChanged="SelectionChanged"/>
                        <Label Content="{loc:Tr Templates}" Grid.Row="1" Grid.Column="0"/>
                        <ComboBox Margin="2" IsReadOnly="True" IsEnabled="True" ItemsSource="{Binding Templates}" SelectedIndex="{Binding SelectedTemplate}" Grid.Row="1" Grid.Column="1" SelectionChanged="SelectionChanged"/>
                    </Grid>
                    <WPFSyntaxHighlighter:SyntaxHighlighter Format="js" Name="Translation"/>
                </DockPanel>
            </TabItem>
        </TabControl>
    </DockPanel>
</Dialogs:DialogWindow>
